<?php

namespace App\Datalog\Events;

use App\Datalog\ErrorLog;
use App\Datalog\LaravelDatalogBase;

class EventLog extends LaravelDatalogBase
{
    // 日志名称
    protected $name = 'event';

    // 数据存放位置
    protected $logPath = 'datalogs/events';

    // 数据格式化方式
    protected $formatter = 'context';

    // 事件id
    protected $eventId = 0;

    protected $maxSaveDay = 30;

    public function addEventLog($user_id, $create_time, $params)
    {
        $params['#user_id']     = $user_id;
        $params['#create_time'] = $create_time;
        $params['#event_id']    = $this->eventId;
        $params['#event_name']  = $this->name;

        $this->log($params);
    }
}
